package development.bean;

import java.util.Vector;
public class Schedule {

  private String id = "";
  private String code = "";
  private String name = "";
  private String value = "";
  public String[] timelist;
  public String[] valuelist;
  public Entity entity;

  public Schedule() {
  }

  public void setID(String id1) {
    this.id = id1;
  }

  public String getID() {
    return id;
  }

  public void setCode(String code1) {
    this.code = code1;
  }

  public String getCode() {
    return code;
  }

  public void setName(String name1) {
    this.name = name1;
  }

  public String getName() {
    return name;
  }

  public void setValue(String value1) {
    this.value = value1;
  }

  public String getValue() {
    return value;
  }

  public void setValueList(String[] value1) {
    this.valuelist = value1;
  }

  public String[] getValueList() {
    return valuelist;
  }

  public void setTimeList(String[] times) {
    this.timelist = times;
  }

  public String[] getTimeLiString() {
    return timelist;
  }

  public void getDataLTH(String original, String separator) {
    Vector times = new Vector();
    Vector values = new Vector();

    int index = original.indexOf(separator) + 7;
    times.addElement(original.substring(0, index));
    original = original.substring(index);
    index = original.indexOf(separator) - 2;

    while (index >= 0) {
      values.addElement(original.substring(0, index));
      times.addElement(original.substring(index, index + 8));
      original = original.substring(index + 8);
      index = original.indexOf(separator) - 2;
    }
    values.addElement(original);

    valuelist = new String[values.size()];
    timelist = new String[times.size()];
    if (values.size() > 0)
      for (int loop = 0; loop < values.size(); loop++)
        valuelist[loop] = (String) values.elementAt(loop);
        
    if (times.size() > 0)
      for (int loop = 0; loop < times.size(); loop++)
        timelist[loop] = (String) times.elementAt(loop);

  }

}
